package controller;

import java.io.IOException;

import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import util.MoneyControlConstants;
import view.Menu;

import com.sun.lwuit.Display;
import com.sun.lwuit.Form;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;

public class MoneyControl extends MIDlet
{
	private int screen;
	private int action;
	private Form form;
	public MoneyControl()
	{
		this.screen = MoneyControlConstants.SCREEN_MENU;
		this.action = MoneyControlConstants.ACTION_MENU;
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException
	{
		

	}

	protected void pauseApp()
	{
		

	}

	protected void startApp() throws MIDletStateChangeException
	{
		
		try
		{
			String theme = "businessTheme";
			Resources r = Resources.open("/" + theme +  ".res");
			UIManager.getInstance().setThemeProps(r.getTheme(theme));
		} 
		catch (IOException e) 
		{
			e.printStackTrace();
		}
		
		Display.init(this);
		
		this.form = new Menu(this);
			
	}

	public int getScreen()
	{
		return screen;
	}

	public void setScreen(int screen)
	{
		this.screen = screen;
	}

	public int getAction()
	{
		return action;
	}

	public void setAction(int action)
	{
		this.action = action;
	}

	public Form getForm()
	{
		return form;
	}

	public void setForm(Form form)
	{
		this.form = form;
	}
	
}
